#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> height_weight;
typedef pair<int, height_weight> student;

// class comp {
struct comp {
    // public:
    bool operator() (student a, student b) {
        if (a.second.first < b.second.first) {
            return true;
        } else if (a.second.first == b.second.first) {
            return a.second.second < b.second.second;
        } else {
            return false;
        }
    }
};

int main() {
    int nums;
    cin >> nums;
    vector<student> all_student;
    int tmp;
    for (int  i= 0; i < nums; ++i) {
        cin >> tmp;
        all_student.emplace_back(student(i+1, height_weight(tmp, 0)));
    }
    for (int  i= 0; i < nums; ++i) {
        cin >> tmp;
        all_student[i].second.second = tmp;
    }

    // sort
    sort(all_student.begin(), all_student.end(), comp());

    // string
    for (int i = 0; i < nums; ++i) {
        cout << all_student[i].first << " ";
    }

}